{$header}
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">新增询价单 [ <a href="__URL__">返回列表</a> ]</h3>
<div id="result" class="result none"></div>
<form class="form-horizontal well" method='post' id="form1" name="form1" action="__URL__/insert/" class="form">
<php>
    $Inquiry = M('Inquiry');
    $Inquiry->getById($_REQUEST['inquiry_id']);
    </php>
<table cellpadding=3 cellspacing=3 >

<notempty name="_REQUEST.inquiry_id">
        <tr><td>产品</td><td>
            <input type="hidden" name="inquiry_id" value="{$_REQUEST.inquiry_id}">
            <input type="hidden" name="product_id" value="{:$Inquiry->product_id}">
        {:getModelName($Inquiry->product_id,'Product')},{:getPename($Inquiry->product_id)} {:getCas($Inquiry->product_id)}
         </td> 
        </tr>
<else />
<tr>
    <td class="tRight" width="150px">询价时间：</td>
    <td class="tLeft" >
            <input type="text" class="span2" name="create_time" value="{:toDate(time())}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"> 
        </td>
</tr>
    <tr>
    <td class="tRight" >选择已有产品：</td>
    <td class="tLeft" >
            <div class="input-append">
                <input id="q" name="q" class="input-xlarge search-query" placeholder="搜索"><input id="hz" name="product_id" type="hidden"></input>
                <button class="btn" type="button" onclick="filter()"><i class="icon-search"></i>搜索</button>
            </div>
        </td>
    </tr>
    
 </notempty>
 
<tr>
    <td>数量：</td>
    <td>
        <input type="hidden" name='jumpUrl' value="<empty name="jumpUrl"><empty name="_REQUEST.inquiry_id">__APP__/Ask_supplier<else />__APP__/Inquiry</empty><else /> {$jumpUrl}</empty>">
        <input type="text" name="number" value="{:$Inquiry->number}" class="input-xxlarge">
    </td>
</tr>
<tr>
    <td>询单要求：</td>
    <td><textarea class="span12" name="specification" rows="3">{:$Inquiry->remark}</textarea></td>
</tr>
<tr>
    <td>要求交货期：</td>
    <td><input type="text" class="span2" name="delivery_date" value="{:toDate($Inquiry->delivery_date)}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"></td>
</tr>
<tr>
    <td>优先级</td>
    <td>{:configList(C('priority'),'','priority')}</td>
</tr>
<!--暂用specification代替
<tr>
	<td class="tRight">备注(询单要求)：</td>
        <td class="tLeft"><textarea class="span12" name="remark" rows="3">{:$Inquiry->remark}</textarea>
        </td>
</tr>
-->
<tr>
    <td class="tRight">询价单状态：</td>
    <td class="tLeft">{:configList(C('askstatus'),0)}
        </td>
</tr>
<tr>
    <td class="tRight" >经办人：</td>
    <td class="tLeft" >{:modList('User')}</td>
</tr>
<tr>
	<td></td>
	<td class="center" width="300">
	<button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> 创建</button>
	<a class="btn btn-primary offset1" href="javascript:history.go(-1);"><i class="icon-arrow-left icon-white"></i>返回</a>
	</td>
</tr>
</table>
</form>
</div>
</div>
<include file="Public:footer" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/easyui/themes/default/easyui.css">
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/filter-product.js"></script>
<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
<script type="text/javascript">
    function filterSupplier(){ 
        if ($('#cq').val() != "") {
            window.open(APP+'/Supplier/search/keywords/'+$('#cq').val()+'?form=form1&field=cq','selected','directorys=no,toolbar=no,status=no,menubar=no,resizable=yes,width=1000,height=800,top=100,left=120,scrollbars=yes');
        }else
            window.open(APP+'/Supplier/search?form=form1&field=cq','selected','directorys=no,toolbar=no,status=no,menubar=no,resizable=yes,width=1000,height=800,top=100,left=120,scrollbars=yes');
    }
</script>